﻿<UserControl x:Class="Shammateh.Win.UI.Controls.Loading"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300"
             Name="rootElement">
    <UserControl.Triggers>
        <EventTrigger RoutedEvent="UserControl.Loaded">
            <BeginStoryboard>
                <Storyboard Storyboard.TargetName="transform1" Storyboard.TargetProperty="Angle">
                    <DoubleAnimation From="360" To="0" RepeatBehavior="Forever" Duration="0:0:1" />
                </Storyboard>
            </BeginStoryboard>
            <!--<BeginStoryboard>
                <Storyboard Storyboard.TargetName="rectange1" Storyboard.TargetProperty="Width">
                    <DoubleAnimation From="5" To="20" AutoReverse="True" Duration="0:0:0.2" RepeatBehavior="Forever" />
                </Storyboard>
            </BeginStoryboard>-->
            <BeginStoryboard>
                <Storyboard Storyboard.TargetName="transform2" Storyboard.TargetProperty="Angle">
                    <DoubleAnimation From="0" To="360" RepeatBehavior="Forever" Duration="0:0:1.5" />
                </Storyboard>
            </BeginStoryboard>
            <!--<BeginStoryboard>
                <Storyboard Storyboard.TargetName="rectange2" Storyboard.TargetProperty="Height">
                    <DoubleAnimation From="1" To="15" AutoReverse="True" Duration="0:0:0.5" RepeatBehavior="Forever" />
                </Storyboard>
            </BeginStoryboard>-->
        </EventTrigger>
    </UserControl.Triggers>

    <Grid x:Name="LayoutRoot">
        <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
            <StackPanel.Effect>
                <DropShadowEffect Opacity="0.5" BlurRadius="5" ShadowDepth="0" />
            </StackPanel.Effect>
            <Grid Width="20" Height="20">
                <Rectangle Height="15" Width="15" Fill="{Binding BackBrush, ElementName=rootElement}"
                   RenderTransformOrigin="0.5,0.5" x:Name="rectange1" HorizontalAlignment="Center" VerticalAlignment="Center"
                   Margin="5,0,0,0">
                    <Rectangle.RenderTransform>
                        <RotateTransform x:Name="transform1" />
                    </Rectangle.RenderTransform>
                </Rectangle>
                <Rectangle Width="15" Height="15" Fill="{Binding ForeBrush, ElementName=rootElement}"
                   RenderTransformOrigin="0.5,0.5" x:Name="rectange2" HorizontalAlignment="Center" VerticalAlignment="Center"
                   Margin="-5,0,0,0">
                    <Rectangle.RenderTransform>
                        <RotateTransform x:Name="transform2" />
                    </Rectangle.RenderTransform>
                </Rectangle>
            </Grid>
            <TextBlock Margin="12,0,0,0" Foreground="#B7FFFFFF" FontStyle="Italic"
                 Text="{Binding Text, ElementName=rootElement}"></TextBlock>
        </StackPanel>
    </Grid>
</UserControl>